﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using BluetoothMachine.Domains;
using BluetoothMachine.Models;

namespace BluetoothMachine.GlobalStatics
{
    [Attributes.Singleton]
    public class HomeGlobal
    {
        /// <summary>
        /// 检测信息
        /// </summary>
        public AsyncObservableCollection<TestResultsModel> ResultsList { get; set; }
        public AsyncObservableCollection<AsyncObservableCollection<RunMessage>> MessagesList { get; set; }
        public AsyncObservableCollection<AsyncObservableCollection<NGOKDetectModel>> OKNGList { get; set; }
        public CancellationTokenSource ScramToken { get; set; }

        public HomeGlobal()
        {
            ScramToken = new CancellationTokenSource();
            ResultsList = new AsyncObservableCollection<TestResultsModel>();
            MessagesList = new AsyncObservableCollection<AsyncObservableCollection<RunMessage>>();
            OKNGList = new AsyncObservableCollection<AsyncObservableCollection<NGOKDetectModel>>();
            for (int i = 0; i < 10; i++)
            {
                OKNGList.Add(new AsyncObservableCollection<NGOKDetectModel>());
                MessagesList.Add(new AsyncObservableCollection<RunMessage>());
                ResultsList.Add(new TestResultsModel());
            }
        }
    }
}
